package freedom;

import java.util.Scanner;

/**
 * 本类用于练习嵌套分支结构
 * 需求：商品大折案例
 * 接收用户输入的价格，并将打折后的价格输出
 * 打折:10000 5折 5000 8折 3000 9折
 *
 */
public class TestIf02 {
    public static void main(String[] args) {
        daZhe();

    }

    public static void daZhe() {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入商品的价格");
        double price=sc.nextDouble();
        double count=price;
        if (count>=10000){
            count*=0.5;
        }else if(count>=5000){
            count*=0.8;
        }else if (count>=3000){
            count*=0.9;
        }else{
            count=count;
        }
        System.out.println("原价为:"+price+"元"+"打折后的价格:"+count+"元");

    }
}
